package com.lantosec.hmrp.modules.category.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.category.entity.AssetsAccessLog;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * <p>
 * 门禁设备预警日志 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-09
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="AssetsAccessLog对象", description="门禁设备预警日志")
public class AssetsAccessLogVO extends BaseVO<AssetsAccessLog> {
    private static final long serialVersionUID = 1L;


    public AssetsAccessLogVO(AssetsAccessLog entity){
        this.warnLogId = entity.getWarnLogId();
        this.accessId = entity.getAccessId();
        this.antennaId = entity.getAntennaId();
        this.assetsCode = entity.getAssetsCode();
        this.warnTime = entity.getWarnTime();
    }

    @Override
    public AssetsAccessLog convertToEntity(){
        return new AssetsAccessLog(this);
    }


    @ApiModelProperty(value = "ID")
    private Integer warnLogId;

    @ApiModelProperty(value = "门禁设备ID")
    private String accessId;

    @ApiModelProperty(value = "天线ID")
    private String antennaId;

    @ApiModelProperty(value = "资产编码")
    private String assetsCode;

    @ApiModelProperty(value = "预警时间")
    private LocalDateTime warnTime;

    @TableField(exist = false)
    private String flag;
}
